Presenting an image of a scene including multiple objects arranged in a three-dimensional data model typically involves rendering each of the objects visible from the perspective of a viewer or camera. However, determining which objects and which portions of objects are visible can be a complicated problem. One solution has been to use a depth-sorting process known as the “painter's algorithm.”
The painter's algorithm uses a back-to-front approach to rendering objects. All the objects in the scene are sorted in depth order, using the z-positions of the objects in the model. The objects are then rendered one by one in depth order (e.g., drawn to the frame buffer as pixels), beginning with the object furthest from the camera. An object that is in front of a farther object and is obscuring the farther object (from the camera's perspective) will be rendered “on top” of or over the farther object, and so hide those parts of the farther object that are behind the nearer object.